<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  
  <title>MQTT协议 | Hexo</title>
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  <meta name="description" content="特点　　MQTT（Message Queue Telemetry Transport）：遥测传输协议，提供订阅/发布模式，更为简约、轻量，易于使用。针对受限环境（带宽低、网络延迟高、网络通信不稳定），可以简单概括为物联网打造，官方总结特点如下：　　1.使用发布/订阅消息模式，提供一对多的消息发布，解除应用程序耦合　　2. 对负载内容屏蔽的消息传输　　3. 使用 TCP/IP 提供网络连接　　4.">
<meta property="og:type" content="article">
<meta property="og:title" content="MQTT协议">
<meta property="og:url" content="http://yoursite.com/2016/01/12/杂项/1.MQTT协议/index.html">
<meta property="og:site_name" content="Hexo">
<meta property="og:description" content="特点　　MQTT（Message Queue Telemetry Transport）：遥测传输协议，提供订阅/发布模式，更为简约、轻量，易于使用。针对受限环境（带宽低、网络延迟高、网络通信不稳定），可以简单概括为物联网打造，官方总结特点如下：　　1.使用发布/订阅消息模式，提供一对多的消息发布，解除应用程序耦合　　2. 对负载内容屏蔽的消息传输　　3. 使用 TCP/IP 提供网络连接　　4.">
<meta property="og:image" content="http://yoursite.com/images/mqtt-head1.jpg">
<meta property="og:image" content="http://yoursite.com/images/bigindian.jpg">
<meta property="og:image" content="http://yoursite.com/images/mqtt-uft8.jpg">
<meta property="og:updated_time" content="2016-01-29T17:47:36.000Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="MQTT协议">
<meta name="twitter:description" content="特点　　MQTT（Message Queue Telemetry Transport）：遥测传输协议，提供订阅/发布模式，更为简约、轻量，易于使用。针对受限环境（带宽低、网络延迟高、网络通信不稳定），可以简单概括为物联网打造，官方总结特点如下：　　1.使用发布/订阅消息模式，提供一对多的消息发布，解除应用程序耦合　　2. 对负载内容屏蔽的消息传输　　3. 使用 TCP/IP 提供网络连接　　4.">
  
    <link rel="alternative" href="/atom.xml" title="Hexo" type="application/atom+xml">
  
  
    <link rel="icon" href="/favicon.png">
  
  <link href="//fonts.googleapis.com/css?family=Source+Code+Pro" rel="stylesheet" type="text/css">
  <link rel="stylesheet" href="/css/style.css" type="text/css">
  

</head>
<body>
  <div id="container">
    <div id="wrap">
      <header id="header">
  <div id="banner"></div>
  <div id="header-outer" class="outer">
    <div id="header-title" class="inner">
      <h1 id="logo-wrap">
        <a href="/" id="logo">Hexo</a>
      </h1>
      
    </div>
    <div id="header-inner" class="inner">
      <nav id="main-nav">
        <a id="main-nav-toggle" class="nav-icon"></a>
        
          <a class="main-nav-link" href="/">Home</a>
        
          <a class="main-nav-link" href="/archives">Archives</a>
        
      </nav>
      <nav id="sub-nav">
        
          <a id="nav-rss-link" class="nav-icon" href="/atom.xml" title="RSS Feed"></a>
        
        <a id="nav-search-btn" class="nav-icon" title="Search"></a>
      </nav>
      <div id="search-form-wrap">
        <form action="//google.com/search" method="get" accept-charset="UTF-8" class="search-form"><input type="search" name="q" results="0" class="search-form-input" placeholder="Search"><button type="submit" class="search-form-submit">&#xF002;</button><input type="hidden" name="sitesearch" value="http://yoursite.com"></form>
      </div>
    </div>
  </div>
</header>
      <div class="outer">
        <section id="main"><article id="post-杂项/1.MQTT协议" class="article article-type-post" itemscope itemprop="blogPost">
  <div class="article-meta">
    <a href="/2016/01/12/杂项/1.MQTT协议/" class="article-date">
  <time datetime="2016-01-12T12:41:00.000Z" itemprop="datePublished">2016-01-12</time>
</a>
    
  <div class="article-category">
    <a class="article-category-link" href="/categories/杂项/">杂项</a>
  </div>

  </div>
  <div class="article-inner">
    
    
      <header class="article-header">
        
  
    <h1 class="article-title" itemprop="name">
      MQTT协议
    </h1>
  

      </header>
    
    <div class="article-entry" itemprop="articleBody">
      
        <h2 id="u7279_u70B9"><a href="#u7279_u70B9" class="headerlink" title="特点"></a>特点</h2><p>　　MQTT（Message Queue Telemetry Transport）：遥测传输协议，提供订阅/发布模式，更为简约、轻量，易于使用。针对受限环境（带宽低、网络延迟高、网络通信不稳定），可以简单概括为物联网打造，官方总结特点如下：<br>　　1.使用发布/订阅消息模式，提供一对多的消息发布，解除应用程序耦合<br>　　2. 对负载内容屏蔽的消息传输<br>　　3. 使用 TCP/IP 提供网络连接<br>　　4. 有三种消息发布服务质量（QoS:Quality of Service）：<br>　　　　至多一次：消息发布完全依赖底层 TCP/IP 网络，会发生消息丢失或重复<br>　　　　至少一次：确保消息到达，但消息重复可能会发生<br>　　　　只有一次：确保消息到达一次，可以用于在计费系统中，消息重复或丢失会导致不正确的结果<br>　　5. 小型传输，开销很小（固定长度的头部是 2 字节），协议交换最小化，以降低网络流量<br>　　6. 使用 Last Will 和 Testament 特性通知有关各方客户端异常中断的机制</p>
<h2 id="u534F_u8BAE_u683C_u5F0F"><a href="#u534F_u8BAE_u683C_u5F0F" class="headerlink" title="协议格式"></a>协议格式</h2><p>　　简单点说，mqtt协议包含三个部分，分别为：固定头部、可变头部和消息体。每个部分存储的元数据信息如下：</p>
<h4 id="1-__u56FA_u5B9A_u5934_u90E8"><a href="#1-__u56FA_u5B9A_u5934_u90E8" class="headerlink" title="1. 固定头部"></a>1. 固定头部</h4><p>　　mqtt的固定头部为两个字节长度，结构如下图所示：<img src="/images/mqtt-head1.jpg" alt="mqtt-head1.jpg"><br>　　第一个字节(8位)被分成了四个部分，高四位存储了消息的类型，使用4位二进制表示，可代表16种消息类型，除去0和15位置属于保留待用，共14种消息事件类型。：</p>
<h5 id="1-1_Message_Type"><a href="#1-1_Message_Type" class="headerlink" title="1.1 Message Type"></a>1.1 Message Type</h5><table>
<thead>
<tr>
<th style="text-align:left">Mnemonic</th>
<th style="text-align:center">Enumeration</th>
<th style="text-align:left">描述</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left">Reserved</td>
<td style="text-align:center">0</td>
<td style="text-align:left">保留</td>
</tr>
<tr>
<td style="text-align:left">CONNECT</td>
<td style="text-align:center">1</td>
<td style="text-align:left">连接请求</td>
</tr>
<tr>
<td style="text-align:left">CONNACK</td>
<td style="text-align:center">2</td>
<td style="text-align:left">连接回执</td>
</tr>
<tr>
<td style="text-align:left">PUBLISH</td>
<td style="text-align:center">3</td>
<td style="text-align:left">发送消息</td>
</tr>
<tr>
<td style="text-align:left">PUBACK</td>
<td style="text-align:center">4</td>
<td style="text-align:left">发送回执</td>
</tr>
<tr>
<td style="text-align:left">PUBREC</td>
<td style="text-align:center">5</td>
<td style="text-align:left">Publish Received (assured delivery part 1)</td>
</tr>
<tr>
<td style="text-align:left">PUBREL</td>
<td style="text-align:center">6</td>
<td style="text-align:left">Publish Release (assured delivery part 2)</td>
</tr>
<tr>
<td style="text-align:left">PUBCOMP</td>
<td style="text-align:center">7</td>
<td style="text-align:left">Publish Complete (assured delivery part 3)</td>
</tr>
<tr>
<td style="text-align:left">SUBSCRIBE</td>
<td style="text-align:center">8</td>
<td style="text-align:left">客户端订阅请求</td>
</tr>
<tr>
<td style="text-align:left">SUBACK</td>
<td style="text-align:center">9</td>
<td style="text-align:left">订阅请求回执</td>
</tr>
<tr>
<td style="text-align:left">UNSUBSCRIBE</td>
<td style="text-align:center">10</td>
<td style="text-align:left">取消订阅请求</td>
</tr>
<tr>
<td style="text-align:left">UNSUBACK</td>
<td style="text-align:center">11</td>
<td style="text-align:left">取消订阅回执</td>
</tr>
<tr>
<td style="text-align:left">PINGREQ</td>
<td style="text-align:center">12</td>
<td style="text-align:left">心跳</td>
</tr>
<tr>
<td style="text-align:left">PINGRESP</td>
<td style="text-align:center">13</td>
<td style="text-align:left">心跳响应</td>
</tr>
<tr>
<td style="text-align:left">DISCONNECT</td>
<td style="text-align:center">14</td>
<td style="text-align:left">连接断开</td>
</tr>
<tr>
<td style="text-align:left">Reserved</td>
<td style="text-align:center">15</td>
<td style="text-align:left">保留</td>
</tr>
</tbody>
</table>
<h5 id="1-2_DUP_flag_28_u6253_u5F00_u6807_u5FD7_29"><a href="#1-2_DUP_flag_28_u6253_u5F00_u6807_u5FD7_29" class="headerlink" title="1.2 DUP flag(打开标志)"></a>1.2 DUP flag(打开标志)</h5><p>　　保证消息可靠传输，默认为0，只占用一个字节，表示第一次发送。不能用于检测消息重复发送等。只适用于客户端或服务器端尝试重发PUBLISH, PUBREL, SUBSCRIBE 或 UNSUBSCRIBE消息，注意需要满足以下条件：当QoS &gt; 0，消息需要回复确认</p>
<h5 id="1-3_QoS_28Quality_of_Service_2C_u670D_u52A1_u8D28_u91CF_29"><a href="#1-3_QoS_28Quality_of_Service_2C_u670D_u52A1_u8D28_u91CF_29" class="headerlink" title="1.3 QoS(Quality of Service,服务质量)"></a>1.3 QoS(Quality of Service,服务质量)</h5><p>　　使用两个二进制表示PUBLISH类型消息：</p>
<table>
<thead>
<tr>
<th style="text-align:left">QoS value</th>
<th style="text-align:center">bit 2</th>
<th style="text-align:center">bit 1</th>
<th style="text-align:left">Description</th>
<th></th>
<th></th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left">0</td>
<td style="text-align:center">0</td>
<td style="text-align:center">0</td>
<td style="text-align:left">至多一次</td>
<td>发完即丢弃</td>
<td>&lt;=1</td>
</tr>
<tr>
<td style="text-align:left">1</td>
<td style="text-align:center">0</td>
<td style="text-align:center">1</td>
<td style="text-align:left">至少一次</td>
<td>需要确认回复</td>
<td>&gt;=1</td>
</tr>
<tr>
<td style="text-align:left">2</td>
<td style="text-align:center">1</td>
<td style="text-align:center">0</td>
<td style="text-align:left">只有一次</td>
<td>需要确认回复</td>
<td>=1</td>
</tr>
<tr>
<td style="text-align:left">3</td>
<td style="text-align:center">1</td>
<td style="text-align:center">1</td>
<td style="text-align:left">待用，保留位置</td>
<td></td>
<td></td>
</tr>
</tbody>
</table>
<h5 id="1-4_RETAIN_28_u4FDD_u6301_29"><a href="#1-4_RETAIN_28_u4FDD_u6301_29" class="headerlink" title="1.4 RETAIN(保持)"></a>1.4 RETAIN(保持)</h5><p>　　仅针对PUBLISH消息，不同值表示不同含义：<br>　　1：表示发送的消息需要一直持久保存（不受服务器重启影响），不但要发送给当前的订阅者，并且以后新来的订阅了此Topic name的订阅者会马上得到推送。备注：新来乍到的订阅者，只会取出最新的一个RETAIN flag = 1的消息推送。<br>　　0：仅仅为当前订阅者推送此消息。假如服务器收到一个空消息体(zero-length payload)、RETAIN = 1、已存在Topic name的PUBLISH消息，服务器可以删除掉对应的已被持久化的PUBLISH消息。</p>
<h5 id="1-5_Remaining_Length_28_u5269_u4F59_u957F_u5EA6_29"><a href="#1-5_Remaining_Length_28_u5269_u4F59_u957F_u5EA6_29" class="headerlink" title="1.5 Remaining Length(剩余长度)"></a>1.5 Remaining Length(剩余长度)</h5><p>　　该字节存储了消息剩余的byte(字节)数，包含固定头部之后的<strong>可变头部长度</strong>和<strong>消息体长度</strong>。<br>　　单个字节最大值为01111111，16进制为0x7F，10进制为127。单个字节为什么不能是11111111（0xFF）呢？因为MQTT协议规定，<strong>第八位（最高位）若为1，则表示还有后续字节存在</strong>。同时MQTT协议最多允许4个字节表示剩余长度。那么最大长度为：0xFF,0xFF,0xFF,0x7F，二进制表示为:11111111,11111111,11111111,01111111，去掉首位后为：1111111111111111111111111111(共28个1)，转换成十进制为268435455 byte=261120KB=256MB=0.25GB。下面我们看看可变头部的内容！</p>
<h4 id="2-__u53EF_u53D8_u5934_u90E8"><a href="#2-__u53EF_u53D8_u5934_u90E8" class="headerlink" title="2. 可变头部"></a>2. 可变头部</h4><p>　　可变头部中包含了消息的元数据。可变头部包含了协议名称、版本号、连接标志、用户授权和心跳时间等内容，这部分和后面要讲到的CONNECT消息类型有重复，暂时略过！</p>
<h5 id="2-1__u6D88_u606F_u6807_u8BC6_u7B26/_u6D88_u606FID"><a href="#2-1__u6D88_u606F_u6807_u8BC6_u7B26/_u6D88_u606FID" class="headerlink" title="2.1 消息标识符/消息ID"></a>2.1 消息标识符/消息ID</h5><p>　　固定头中的QoS level标志值为1或2时才会在：PUBLISH，PUBACK，PUBREC，PUBREL，PUBCOMP，SUBSCRIBE，SUBACK，UNSUBSCRIBE，UNSUBACK等消息的可变头中出现。<br>　　一个16位无符号位的short类型值（值不能为 0，0做保留作为无效的消息ID），仅仅要求在一个特定方向（服务器发往客户端为一个方向，客户端发送到服务器端为另一个方向）的通信消息中必须唯一。比如客户端发往服务器，有可能存在服务器发往客户端会同时存在重复，但不碍事。<br>　　可变头部中，需要两个字节的顺序是MSB(Most Significant Bit) LSB(Last/Least Significant Bit)，翻译成中文就是，最高有效位，最低有效位。最高有效位在最低有效位左边/上面，表示这是一个大端字节/网络字节序，符合人的阅读习惯，高位在最左边。<img src="/images/bigindian.jpg" alt="bigindian.jpg"><br>　　但凡如此表示的，都可以视为一个16位无符号short类型整数，两个字节表示。在JAVA中处理比较简单：DataInputStream.readUnsignedShort 或者 in.read() * 0xFF + in.read();最大长度可为： 65535</p>
<h4 id="3-_Playload/_u6D88_u606F_u4F53/_u8D1F_u8377"><a href="#3-_Playload/_u6D88_u606F_u4F53/_u8D1F_u8377" class="headerlink" title="3. Playload/消息体/负荷"></a>3. Playload/消息体/负荷</h4><p>　　消息体主要是为配合固定/可变头部命令（比如CONNECT可变头部User name标记若为1，则需要在消息体中附加用户名称字符串）而存在。<br>　　CONNECT/SUBSCRIBE/SUBACK/PUBLISH等消息有消息体。PUBLISH的消息体以二进制形式对待。<br>　　MQTT协议只允许在PUBLISH类型消息体中使用自定义特性，在固定/可变头部想加入自定义私有特性，就免了吧。这也是为了协议免于流于形式，变得很分裂也为了兼顾现有客户端等。比如支持压缩等，那就可以在Playload中定义数据支持，在应用中进行读取处理。</p>
<h4 id="4-_UTF-8_u7F16_u7801"><a href="#4-_UTF-8_u7F16_u7801" class="headerlink" title="4. UTF-8编码"></a>4. UTF-8编码</h4><p>　　有关字符串，MQTT采用的是修改版的UTF-8编码，一般形式为如下，需要牢记：<img src="/images/mqtt-uft8.jpg" alt="mqtt-uft8.jpg"><br>　　比如JAVA，使用writeUTF()方法写入一串文字“OTWP”，头两个字节为一个完整的无符号数字，代表字符串字节长度，后面四个字节才是字符串真正的长度，共六个字节。<br>　　MQTT无论是可变头部还是消息体中，只要是字符串部分，都是采用了修改版的UTF-8编码，读取和写入，借助DataInputStream/DataOutputStream的帮助，一行语句，略去了手动处理的麻烦。</p>
<h2 id="u79FB_u52A8_u4E92_u8054_u7F51_u4F7F_u7528"><a href="#u79FB_u52A8_u4E92_u8054_u7F51_u4F7F_u7528" class="headerlink" title="移动互联网使用"></a>移动互联网使用</h2><p>　　手机等终端在弱网络环境下丢包情况会非常明显，连接MQTT Server成功率很低。相比单纯的请求-相应模型的HTTP，其成功率会比MQTT订阅成功高很多。<br>　　手机终端在每次TCP断开或断网后，会即刻发起TCP重连，连接成功，会重复以前步骤依次发送连接命令（CONNECT），订阅命令（SUBSCRIBLE），表明上看，这些过程没有任何问题，但问题就在于从终端成功建立到服务器的连接，到发送订阅命令，在弱网情况下，这个过程将会变得很昂贵：<strong>从TCP建立开始的三次握手到完整的订阅命令发送完毕，考虑到TCP堆栈的每次接收数据方响应ACK，这中间终端和服务器端至少产生了10次数据交互。</strong></p>
<h2 id="u534F_u8BAE_u4F18_u5316"><a href="#u534F_u8BAE_u4F18_u5316" class="headerlink" title="协议优化"></a>协议优化</h2><p>　　1. 客户端连接成功，服务端回执连接成功状态等过程可以省略<br>　　2. 消息头包含有过多的元数据信息，如QoS等，可以省略<br>　　3. 心跳命令PINGREQ/PINGREQ可以做到一个字节传输，节省一个字节</p>
<h2 id="u53C2_u8003_u94FE_u63A5"><a href="#u53C2_u8003_u94FE_u63A5" class="headerlink" title="参考链接"></a>参考链接</h2><p><a href="http://www.blogjava.net/yongboy/archive/2014/02/07/409587.html" target="_blank" rel="external">http://www.blogjava.net/yongboy/archive/2014/02/07/409587.html</a><br><a href="http://www.blogjava.net/yongboy/archive/2014/12/12/421331.html" target="_blank" rel="external">http://www.blogjava.net/yongboy/archive/2014/12/12/421331.html</a><br><a href="http://www.cnblogs.com/caca/p/mqtt.html" target="_blank" rel="external">http://www.cnblogs.com/caca/p/mqtt.html</a><br><a href="http://www.blogjava.net/yongboy/category/54835.html" target="_blank" rel="external">http://www.blogjava.net/yongboy/category/54835.html</a></p>

      
    </div>
    <footer class="article-footer">
      <a data-url="http://yoursite.com/2016/01/12/杂项/1.MQTT协议/" data-id="cijzzpv0n000l1cfse3gqk6bo" class="article-share-link">Share</a>
      
      
  <ul class="article-tag-list"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/mqtt/">mqtt</a></li></ul>

    </footer>
  </div>
  
    
<nav id="article-nav">
  
    <a href="/2016/01/12/杂项/2.消息推送技术方案/" id="article-nav-newer" class="article-nav-link-wrap">
      <strong class="article-nav-caption">Newer</strong>
      <div class="article-nav-title">
        
          消息推送技术方案
        
      </div>
    </a>
  
  
    <a href="/2016/01/12/mq/6.Kafka系列之ZeroCopy/" id="article-nav-older" class="article-nav-link-wrap">
      <strong class="article-nav-caption">Older</strong>
      <div class="article-nav-title">Kafka系列三之ZeroCopy</div>
    </a>
  
</nav>

  
</article>

</section>
        
          <aside id="sidebar">
  
    
  <div class="widget-wrap">
    <h3 class="widget-title">Categories</h3>
    <div class="widget">
      <ul class="category-list"><li class="category-list-item"><a class="category-list-link" href="/categories/cache/">cache</a><span class="category-list-count">3</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/database/">database</a><span class="category-list-count">13</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/docker/">docker</a><span class="category-list-count">6</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/gis/">gis</a><span class="category-list-count">4</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/git/">git</a><span class="category-list-count">2</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/go/">go</a><span class="category-list-count">1</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/gradle/">gradle</a><span class="category-list-count">1</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/groovy/">groovy</a><span class="category-list-count">1</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/hadoop/">hadoop</a><span class="category-list-count">1</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/java/">java</a><span class="category-list-count">18</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/linux/">linux</a><span class="category-list-count">4</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/log/">log</a><span class="category-list-count">11</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/mongodb/">mongodb</a><span class="category-list-count">14</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/mq/">mq</a><span class="category-list-count">6</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/mybatis/">mybatis</a><span class="category-list-count">9</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/netty/">netty</a><span class="category-list-count">1</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/nginx/">nginx</a><span class="category-list-count">3</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/nio/">nio</a><span class="category-list-count">19</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/nodejs/">nodejs</a><span class="category-list-count">1</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/redis/">redis</a><span class="category-list-count">6</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/rpc/">rpc</a><span class="category-list-count">14</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/spring/">spring</a><span class="category-list-count">5</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/tomcat/">tomcat</a><span class="category-list-count">2</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/zookeeper/">zookeeper</a><span class="category-list-count">2</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/杂项/">杂项</a><span class="category-list-count">2</span></li></ul>
    </div>
  </div>

  
    
  <div class="widget-wrap">
    <h3 class="widget-title">Tags</h3>
    <div class="widget">
      <ul class="tag-list"><li class="tag-list-item"><a class="tag-list-link" href="/tags/aop/">aop</a><span class="tag-list-count">8</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/aspectj/">aspectj</a><span class="tag-list-count">3</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/cache/">cache</a><span class="tag-list-count">3</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/classloader/">classloader</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/common-loggings/">common-loggings</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/commonjs/">commonjs</a><span class="tag-list-count">4</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/database/">database</a><span class="tag-list-count">10</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/docker/">docker</a><span class="tag-list-count">6</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/dubbo/">dubbo</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/fastdfs/">fastdfs</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/gclib/">gclib</a><span class="tag-list-count">2</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/geohash/">geohash</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/gis/">gis</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/git/">git</a><span class="tag-list-count">2</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/go/">go</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/gradle/">gradle</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/groovy/">groovy</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/hadoop/">hadoop</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/hessisan/">hessisan</a><span class="tag-list-count">3</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/java/">java</a><span class="tag-list-count">48</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/javassist/">javassist</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/kafka/">kafka</a><span class="tag-list-count">3</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/linux/">linux</a><span class="tag-list-count">4</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/log/">log</a><span class="tag-list-count">11</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/log4j/">log4j</a><span class="tag-list-count">4</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/logback/">logback</a><span class="tag-list-count">5</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/map/">map</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/memecached/">memecached</a><span class="tag-list-count">2</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/mina/">mina</a><span class="tag-list-count">5</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/mongodb/">mongodb</a><span class="tag-list-count">14</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/mq/">mq</a><span class="tag-list-count">6</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/mqtt/">mqtt</a><span class="tag-list-count">2</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/mybatis/">mybatis</a><span class="tag-list-count">9</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/netty/">netty</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/nginx/">nginx</a><span class="tag-list-count">3</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/nio/">nio</a><span class="tag-list-count">5</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/nodejs/">nodejs</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/postgresql/">postgresql</a><span class="tag-list-count">2</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/protobuf/">protobuf</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/proxy/">proxy</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/push/">push</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/rabbitmq/">rabbitmq</a><span class="tag-list-count">3</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/redis/">redis</a><span class="tag-list-count">6</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/rpc/">rpc</a><span class="tag-list-count">14</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/sitemesh/">sitemesh</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/sld/">sld</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/slf4j/">slf4j</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/socket/">socket</a><span class="tag-list-count">7</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/spatialite-for-android/">spatialite for android</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/spi/">spi</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/spring/">spring</a><span class="tag-list-count">13</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/tomcat/">tomcat</a><span class="tag-list-count">2</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/transaction/">transaction</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/web/">web</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/xSocket/">xSocket</a><span class="tag-list-count">7</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/zbus/">zbus</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/zookeeper/">zookeeper</a><span class="tag-list-count">2</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/数据结构/">数据结构</a><span class="tag-list-count">2</span></li></ul>
    </div>
  </div>

  
    
  <div class="widget-wrap">
    <h3 class="widget-title">Tag Cloud</h3>
    <div class="widget tagcloud">
      <a href="/tags/aop/" style="font-size: 15.38px;">aop</a> <a href="/tags/aspectj/" style="font-size: 11.54px;">aspectj</a> <a href="/tags/cache/" style="font-size: 11.54px;">cache</a> <a href="/tags/classloader/" style="font-size: 10px;">classloader</a> <a href="/tags/common-loggings/" style="font-size: 10px;">common-loggings</a> <a href="/tags/commonjs/" style="font-size: 12.31px;">commonjs</a> <a href="/tags/database/" style="font-size: 16.92px;">database</a> <a href="/tags/docker/" style="font-size: 13.85px;">docker</a> <a href="/tags/dubbo/" style="font-size: 10px;">dubbo</a> <a href="/tags/fastdfs/" style="font-size: 10px;">fastdfs</a> <a href="/tags/gclib/" style="font-size: 10.77px;">gclib</a> <a href="/tags/geohash/" style="font-size: 10px;">geohash</a> <a href="/tags/gis/" style="font-size: 10px;">gis</a> <a href="/tags/git/" style="font-size: 10.77px;">git</a> <a href="/tags/go/" style="font-size: 10px;">go</a> <a href="/tags/gradle/" style="font-size: 10px;">gradle</a> <a href="/tags/groovy/" style="font-size: 10px;">groovy</a> <a href="/tags/hadoop/" style="font-size: 10px;">hadoop</a> <a href="/tags/hessisan/" style="font-size: 11.54px;">hessisan</a> <a href="/tags/java/" style="font-size: 20px;">java</a> <a href="/tags/javassist/" style="font-size: 10px;">javassist</a> <a href="/tags/kafka/" style="font-size: 11.54px;">kafka</a> <a href="/tags/linux/" style="font-size: 12.31px;">linux</a> <a href="/tags/log/" style="font-size: 17.69px;">log</a> <a href="/tags/log4j/" style="font-size: 12.31px;">log4j</a> <a href="/tags/logback/" style="font-size: 13.08px;">logback</a> <a href="/tags/map/" style="font-size: 10px;">map</a> <a href="/tags/memecached/" style="font-size: 10.77px;">memecached</a> <a href="/tags/mina/" style="font-size: 13.08px;">mina</a> <a href="/tags/mongodb/" style="font-size: 19.23px;">mongodb</a> <a href="/tags/mq/" style="font-size: 13.85px;">mq</a> <a href="/tags/mqtt/" style="font-size: 10.77px;">mqtt</a> <a href="/tags/mybatis/" style="font-size: 16.15px;">mybatis</a> <a href="/tags/netty/" style="font-size: 10px;">netty</a> <a href="/tags/nginx/" style="font-size: 11.54px;">nginx</a> <a href="/tags/nio/" style="font-size: 13.08px;">nio</a> <a href="/tags/nodejs/" style="font-size: 10px;">nodejs</a> <a href="/tags/postgresql/" style="font-size: 10.77px;">postgresql</a> <a href="/tags/protobuf/" style="font-size: 10px;">protobuf</a> <a href="/tags/proxy/" style="font-size: 10px;">proxy</a> <a href="/tags/push/" style="font-size: 10px;">push</a> <a href="/tags/rabbitmq/" style="font-size: 11.54px;">rabbitmq</a> <a href="/tags/redis/" style="font-size: 13.85px;">redis</a> <a href="/tags/rpc/" style="font-size: 19.23px;">rpc</a> <a href="/tags/sitemesh/" style="font-size: 10px;">sitemesh</a> <a href="/tags/sld/" style="font-size: 10px;">sld</a> <a href="/tags/slf4j/" style="font-size: 10px;">slf4j</a> <a href="/tags/socket/" style="font-size: 14.62px;">socket</a> <a href="/tags/spatialite-for-android/" style="font-size: 10px;">spatialite for android</a> <a href="/tags/spi/" style="font-size: 10px;">spi</a> <a href="/tags/spring/" style="font-size: 18.46px;">spring</a> <a href="/tags/tomcat/" style="font-size: 10.77px;">tomcat</a> <a href="/tags/transaction/" style="font-size: 10px;">transaction</a> <a href="/tags/web/" style="font-size: 10px;">web</a> <a href="/tags/xSocket/" style="font-size: 14.62px;">xSocket</a> <a href="/tags/zbus/" style="font-size: 10px;">zbus</a> <a href="/tags/zookeeper/" style="font-size: 10.77px;">zookeeper</a> <a href="/tags/数据结构/" style="font-size: 10.77px;">数据结构</a>
    </div>
  </div>

  
    
  <div class="widget-wrap">
    <h3 class="widget-title">Archives</h3>
    <div class="widget">
      <ul class="archive-list"><li class="archive-list-item"><a class="archive-list-link" href="/archives/2016/01/">January 2016</a><span class="archive-list-count">67</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2015/12/">December 2015</a><span class="archive-list-count">81</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2015/11/">November 2015</a><span class="archive-list-count">2</span></li></ul>
    </div>
  </div>

  
    
  <div class="widget-wrap">
    <h3 class="widget-title">Recents</h3>
    <div class="widget">
      <ul>
        
          <li>
            <a href="/2016/01/30/资料/">(no title)</a>
          </li>
        
          <li>
            <a href="/2016/01/30/java/13.Classloader系列一/">ClassLoader系列一</a>
          </li>
        
          <li>
            <a href="/2016/01/29/hadoop/1.hadoop系列之源码编译/">hadoop系列一之源码编译</a>
          </li>
        
          <li>
            <a href="/2016/01/29/go/1.GO系列之入门/">Go系列一之入门</a>
          </li>
        
          <li>
            <a href="/2016/01/28/tomcat/2.tomcat性能优化/">tomcat性能优化</a>
          </li>
        
      </ul>
    </div>
  </div>

  
</aside>
        
      </div>
      <footer id="footer">
  
  <div class="outer">
    <div id="footer-info" class="inner">
      &copy; 2016 John Doe<br>
      Powered by <a href="http://hexo.io/" target="_blank">Hexo</a>
    </div>
  </div>
</footer>
    </div>
    <nav id="mobile-nav">
  
    <a href="/" class="mobile-nav-link">Home</a>
  
    <a href="/archives" class="mobile-nav-link">Archives</a>
  
</nav>
    


<script src="http://libs.baidu.com/jquery/2.0.3/jquery.min.js"></script>


  <link rel="stylesheet" href="/fancybox/jquery.fancybox.css" type="text/css">
  <script src="/fancybox/jquery.fancybox.pack.js" type="text/javascript"></script>


<script src="/js/script.js" type="text/javascript"></script>

  </div>
</body>
</html>